import { ref, unref, computed, markRaw } from 'vue'

import BwNodeCss from './css/index.vue'
export function useComCss() {
  const isMax = ref<boolean>(false)
  const activeKey = ref<'css' | 'style'>('css')

  const curEle = computed(() => {
    let ele: any = null
    switch (unref(activeKey)) {
      case 'css': {
        ele = markRaw(BwNodeCss)
        break
      }
    }

    return ele
  })

  const onSize = (is: boolean) => {
    isMax.value = is
  }

  return { activeKey, curEle, isMax, onSize }
}
